def freeze_effective(clip, t=0, freeze_duration=None, total_duration=None,
                     padding_end=0):
    if t == 'end':
        t = clip.duration - padding_end
    if freeze_duration is None:
        freeze_duration = total_duration - clip.duration
    if total_duration is None:
        total_duration = clip.duration + freeze_duration
    result = clip.fl_time(lambda tx: tx if tx < t else t if tx < (t + freeze_duration) else tx - freeze_duration)
    return result.set_duration(total_duration)
